<?php


namespace sffi\phlegethon;


use sffi\phlegethon\util\ConfigUtil;

class PushValid
{
    public function valid(\Closure $callback)
    {
        $data = $_POST;
        $config = ConfigUtil::getConfigFile('phlegethon.php');
        $sign = md5($config['key'].$data['factor'].$data['account']);
        if ($sign == $data['validate_code']){
            $callback($data);
        }
        throw new \Exception('无效访问', 1000088);
    }
}